Func Gun_Button()

	$cstate = GUICtrlRead($Gun_AimOn)
	if $cstate = $GUI_CHECKED then 
		$Gun_data = Sqrt(GUICtrlRead($Gun_Delay_1)*GUICtrlRead($Gun_Delay_1))
		GUICtrlSetState($Gun_Label_7 , $GUI_ENABLE)
		GUICtrlSetState($Gun_Delay_1 , $GUI_ENABLE)
	elseif $cstate = $GUI_UNCHECKED then 
		$Gun_data = "-" & Sqrt(GUICtrlRead($Gun_Delay_1)*GUICtrlRead($Gun_Delay_1))
		GUICtrlSetState($Gun_Label_7 , $GUI_DISABLE)
		GUICtrlSetState($Gun_Delay_1 , $GUI_DISABLE)
	EndIf

	IniWrite ( "attackhack.ini", "gun", "aimdelay", $Gun_data)
EndFunc


Func AimOn()

		GUICtrlSetState($Gun_Label_7 , $GUI_ENABLE)
		GUICtrlSetState($Gun_Delay_1 , $GUI_ENABLE)
		$Gun_data = Sqrt(GUICtrlRead($Gun_Delay_1)*GUICtrlRead($Gun_Delay_1))
		IniWrite ( "attackhack.ini", "gun", "aimdelay", $Gun_data)

EndFunc

Func AimOff()

		GUICtrlSetState($Gun_Label_7 , $GUI_DISABLE)
		GUICtrlSetState($Gun_Delay_1 , $GUI_DISABLE)
		$Gun_data = "-" & Sqrt(GUICtrlRead($Gun_Delay_1)*GUICtrlRead($Gun_Delay_1))
		IniWrite ( "attackhack.ini", "gun", "aimdelay", $Gun_data)

EndFunc

Func Gun_Shot1()

	GUICtrlSetState($Gun_Label_1, $GUI_ENABLE)
	GUICtrlSetState($Gun_Label_2, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_3, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_4, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_5, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_6, $GUI_DISABLE)
	$special = "1"
	IniWrite ( "attackhack.ini", "gun", "specials", $special)

EndFunc

Func Gun_Shot2()
	GUICtrlSetState($Gun_Label_1, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_2, $GUI_ENABLE)
	GUICtrlSetState($Gun_Label_3, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_4, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_5, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_6, $GUI_DISABLE)
	$special = "2"
	IniWrite ( "attackhack.ini", "gun", "specials", $special)

EndFunc

Func Gun_Shot3()
	GUICtrlSetState($Gun_Label_1, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_2, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_3, $GUI_ENABLE)
	GUICtrlSetState($Gun_Label_4, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_5, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_6, $GUI_DISABLE)
	$special = "3"
	IniWrite ( "attackhack.ini", "gun", "specials", $special)

EndFunc

Func Gun_Shot4()
	GUICtrlSetState($Gun_Label_1, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_2, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_3, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_4, $GUI_ENABLE)
	GUICtrlSetState($Gun_Label_5, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_6, $GUI_DISABLE)
	$special = "4"
	IniWrite ( "attackhack.ini", "gun", "specials", $special)

EndFunc

Func Gun_Shot5()
	GUICtrlSetState($Gun_Label_1, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_2, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_3, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_4, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_5, $GUI_ENABLE)
	GUICtrlSetState($Gun_Label_6, $GUI_DISABLE)
	$special = "5"
	IniWrite ( "attackhack.ini", "gun", "specials", $special)

EndFunc

Func Gun_Shot6()
	GUICtrlSetState($Gun_Label_1, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_2, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_3, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_4, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_5, $GUI_DISABLE)
	GUICtrlSetState($Gun_Label_6, $GUI_ENABLE)
	$special = "6"
	IniWrite ( "attackhack.ini", "gun", "specials", $special)

EndFunc

Func gun()
	If (WinActive("Pirates")) Then
		$guninfo = IniReadSection("attackhack.ini", "gun" )
		HotKeySet("{F2}")
		$activeWeapon = 2
		Sleep(500)
		Send("{F2}")
		HotKeySet("{F2}", "idle")


		Send("{LCTRL}")
		Sleep(1000)
		Send("{LCTRL}")
		Sleep(1000)	
		Send($guninfo[2][1])
		
		While 1
			If (WinActive("Pirates")) Then
				Send("{LCTRL}")
				Sleep(300)
			EndIf
		WEnd
	EndIf
EndFunc